Copyright: Help Edit - UNREGISTERED COPY


Main Index
Help Edit - Unregistered Evaluation Copy

Plot3d for Windows

               Version 1.2

Robert Brodt

486 Linden Ave.

Bogota, NJ 07603

Compuserve ID: 71165,550

Copyright (c) 1993, Chameleon Software, Inc.

Topics

Introduction

Coordinate Systems

Equations

Plot File Format

Menu

File Menu

Edit Dialog

Options Menu

Help Menu


Introduction

Plot3d is a general 3-D equation plotting program. It allows you to define

any equations in either cartesian, cylindrical or spherical coordinates.

The equations are evaluated over a specified domain and then drawn as a

3-dimensional wireframe graph.

You can then view the graph as a perspective or orthographic projection,

and tilt and rotate the graph to get a better feel for how the equation

"behaves".

The program tries to scale the resulting graph so that it will fit into the

program's window, based on the minimum and maximum values for

the Coordinate System.

The result can then be saved in a specially formatted Plot File or printed.


File Menu

The File Menu allows you to load and save Plot3d equations and settings.

See Plot File Formats for a description of plot files.

Open

Save

Save As

Print

Exit


Edit Dialog

This is where you enter and change your equations. The Edit Dialog box

allows you to select the coordinate system you wish to work in, and the

equation's dependent variable.

The program stores equations for each coordinate system and dependent

variable combination, thus you can define and plot nine different equations.

Also in the Edit Dialog box are the equation's Domain where you can enter

the minimum, maximum and number of increments over which your equation

will be evaluated.

All angular values in the domain fields (theta and phi) must be entered in degrees.

These will be converted to radians when the equation is evaluated.


Options Menu

This menu has the following items:

Coordinate System...

Line Style...

Stop Plotting


Coordinate System Menu

Coordinate System

This menu item allows you to define lower and upper boundaries of the

the Coordinate System  you want to use for your equation.

The minimum and maximum values of the Coordinate System are used to

scale the drawing to fit into the display window.

This dialog box also lets you select whether you want a perspective or

orthographic projection and the viewing angle of the graph.


Coordinate Systems

Plot3d allows you to use three different coordinate systems: Cartesian,

Cylindrical and Spherical. Cartesian coordinates are defined by three orthogonal axes

named x, y and z (see Figure 1. below).

As you can see, values for x, y and z  may range from negative to positive

infinity.

Cylindrical coordinates are defined by three quantities: r which is measured

as the distance from the Z axis; theta is an angle measured counter-clockwise

from the X axis and z which is the distance along the Z axis (see Figure 2.)

Spherical coordinates are also defined by three quantities, but two of these

are angles named theta and phi, and the third is a measure of the distance

from the origin and is named rho

The values for theta and phi may range from 0 to 360 degrees

and 0 t0 180 degrees respectively and rho ranges from 0 to positive infinity.


Line Style Menu

Line Style

This menu item allows you to set the line thickness used for drawing the

equation, and whether to use colors.

The line color used is arbitrary and depends on the average z-value of the

line segment drawn. This has the effect of displaying the equation as a

contour map.


Help Menu

You're lookin' at it!


Plot File Format

Plot files are plain ASCII text files that contain Plot3d equations and other

settings. There are six sections in a plot file, each begins with a section

title and ends with a blank line. Each section roughly corresponds to the

information contained in the Edit, Coordinate System and Line Style

Dialog boxes. The following is a sample plot file:

[LineStyle]

LineWidth=1

Color=yes

[CoordinateSystem]

System=Cartesian

DependentVariable=X

Projection=Perspective

Tilt=30

Rotation=30

xMin=-10

xMax=10

yMin=-10

yMax=10

zMin=0

zMax=11

[EquationCartesianX]

x=10

[Domain]

Ymin=-8

Ymax=8

Ysteps=20

Zmin=-8

Zmax=8

Zsteps=40

[EquationCartesianY]

d=sqrt(x*x + z*z)

y=-10*pow( sin(d)/d, 2 )

[Domain]

Xmin=-10

Xmax=10

Xsteps=20

Zmin=-8

Zmax=8

Zsteps=40

[EquationCartesianZ]

//

// Fraunhofer diffraction through

// a circular aperture.

//

d = sqrt(x*x + y*y)

z = 10.0 * pow( sin(d)/d, 2.0 )

[Domain]

Xmin=-10

Xmax=10

Xsteps=20

Ymin=-8

Ymax=8

Ysteps=20

[EquationCylindricalR]

r=10

[Domain]

Thetamin=0

Thetamax=360

Thetasteps=20

Zmin=0

Zmax=10

Zsteps=20

[EquationCylindricalTheta]

theta=10

[Domain]

Rmin=0

Rmax=10

Rsteps=20

Zmin=0

Zmax=10

Zsteps=20

[EquationCylindricalZ]

z=10

[Domain]

Rmin=0

Rmax=10

Rsteps=20

Thetamin=0

Thetamax=360

Thetasteps=20

[EquationSphericalRho]

rho=10

[Domain]

Phimin=0

Phimax=180

Phisteps=20

Thetamin=0

Thetamax=360

Thetasteps=20

[EquationSphericalPhi]

phi=45

[Domain]

Rhomin=0

Rhomax=10

Rhosteps=20

Thetamin=0

Thetamax=360

Thetasteps=20

[EquationSphericalTheta]

theta=10

[Domain]

Rhomin=0

Rhomax=10

Rhosteps=20

Phimin=0

Phimax=180

Phisteps=20


Equations

You can think of Plot3d equations as functions that have the independent

variables as arguments and return the result of the equation in the dependent

variable. Equations in Plot3d follow the same syntax as the C language; all of the

mathematical operators are supported. An equation can be any number

of mathematical expressions covering several lines, but the result must

be an assignment to the  dependent variable selected. The function is

called repeatedly for all values of the two independent variables (the

domain of the function) and should supply a value to

the dependent variable.

Note that all angular values (theta and phi) will be in radians when the equation

is evaluated, even though they were specified in the Edit Dialog as degrees.

The Plot3d calculator engine is actually a P-code interpreter that compiles

your mathematical expressions into a pseudo code and then executes it.

This compiler/interpreter also understands the conditional if-else statement

and looping statements while and for as defined by the C language.

Also there are several transcendental and other high-level functions and

predefined constants (such as PI) available.

You may also use variables up to 32 characters long to store intermediate

results. The contents of these variables are saved from one iteration of

the equation to the next (i.e. while the graph is being drawn).

Summary

Unary Operators:

                -	Negation

                !	Logical NOT

                ~	Binary NOT

Binary Operators:

                /	Division

                *	Multiplication

                %	Modulo division

                +	Addition

                -	Subtraction

                <<	Shift left

                >>	Shift right

                <	Less than

                <=	Less or equal

                >|	Greater than

                >=	Greater or equal

                ==	Equality

                !=	Inequality

                &	Binary AND

                |	Binary exclusive OR

                ^	Binary inclusive OR

                &&	Logical AND

                ||	Logical OR

Functions:

                abs(a)	absolute value

                acos(a)	arc cosine

                asin(a)	arc sine

                atan(a)	arc tangent

                atan2(a,b)	arc tangent

                ceil(a)	returns smallest integer not less than "a"

                cos(a)	cosine

                cosh(a)	hyperbolic cosine

                degrees(a)	convert "a" from radians to degrees

                exp(a)	raise e to the power of "a"

                floor(a)	returns largest integer not greater than "a"

                log(a)	natural log

                log10(a)	log base 10

                pow(a,b)	raise "a" to the power of "b"

                radians(a)	convert "a" from degrees to radians

                sin(a)	sine

                sinh(a)	hyperbolic sine

                sqrt(a)	square root

                tan(a)	tangent

                tanh(a)	hyperbolic tangent

Constants:

                E	2.71828182845904523536

                LOG2E	1.44269504088896340736

                LOG10E	0.434294481903251827651

                LN2	0.693147180559945309417

                LN10	2.30258509299404568402

                PI	3.14159265358979323846

                PI_2	1.57079632679489661923

                PI_4	0.785398163397448309616

                SQRTPI	0.564189583547756286948

                SQRT2	1.41421356237309504880

                SQRT_2	0.707106781186547524401

Conditional and looping statements:

                if ( <condition> )

                        <statement>

                else

                        <statement>

                for ( <init>; <test>; <inc> )

                        <statement>

                while ( <condition> )

                        <statement>


Open File

Loads a Plot file. If you have made any changes to the

Plot equation or other settings, you will first be asked

if you want to save them before loading the new Plot file.


Save File

Saves your current Plot equation and settings.


Save File As

Saves your current Plot equation and settings

under a different file name.


Print File

Sends the plot output to the printer. A printer dialog box

allows you to select and set up the printer before printing

starts.


Stop Plotting

Interrupts drawing of the equation on the screen.

This is useful if you have made a mistake and don't

want to wait for the drawing to finish.


Exit

Exits Plot3d. If you have made any changes to the equations

or settings, you will first be asked if you want to save them.


Domain

A domain is the set of lower and upper boundaries

over which a function is evaluated.


Orthogonal

Three lines are said to be orthogonal if they

are at right angles to each other.


Perspective Drawing

A Perspective drawing of a 3-dimensional object

is the view that is normally seen by the eye or a

camera. All parallel lines tend to converge on a

"vanishing point" as they recede from the observer.


Orthographic Projection

An Orthographic projection of a 3-dimensional object

is one in which the projecting lines are perpendicular

to the viewing plane.

An orthographic projection would result if an object

could be seen from infinitely far away;  orthographic

drawings tend to appear distorted to the human eye.